import React, { Component } from 'react';
import indexCss from "./index.module.scss";
class SliderBar extends Component {

  // 定义默认属性
  static defaultProps = {
    show: false,
    direction: "right",
    style: {}
  }

  render() {

    const { show, direction, style } = this.props;
    const outCls = indexCss[`slider_bar_${direction}_out`];
    const inCls = indexCss[`slider_bar_${direction}_in`];
    return (
      <div className={
        [
          indexCss.slider_bar,
          outCls,
          show ? inCls : ''
        ].join(" ")
      }
        style={style}
      >
        {this.props.children}
      </div>
    );
  }
}
export default SliderBar;